package com.example.mybatisdemo.controller;

import com.example.mybatisdemo.entity.Items;
import com.example.mybatisdemo.service.ItemsService;
import com.example.mybatisdemo.utils.ResultInfoVOUtil;
import com.example.mybatisdemo.vo.PageResultVO;
import com.example.mybatisdemo.vo.ResultInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * 商品表 商品信息相关表：分类表，商品图片表，商品规格表，商品参数表(Items)表控制层
 *
 * @author 敲代码的卡卡罗特  公众号：干货食堂
 * @since 2020-05-12 22:53:11
 */
@RestController
@RequestMapping("/items")
public class ItemsController {
    /**
     * 服务对象
     */
    @Autowired
    private ItemsService itemsService;

    /**
     * 分页查询
     * @return
     */
    @PostMapping("/getListByPage")
    public ResultInfoVO<PageResultVO<Items>> getListByPage(){
        PageResultVO<Items> vo = itemsService.getListByPage(new Items());
        return ResultInfoVOUtil.buildSuccess(vo);
    }
}
